package com.findu.activity;

import com.example.findu.R;
import com.example.findu.R.layout;
import com.example.findu.R.menu;
import com.findu.control.Public_title_dynamic;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 
* @ClassName: Relatives_information_details 
* @Description: TODO(实现亲友详细资料) 
* @author hgf
* @date 2015-11-2 下午12:13:12 
*
 */
public class Relatives_information_details extends Activity implements OnClickListener{
	//声明标题
	private Public_title_dynamic public_title;	
	private ImageView public_title_LeftImage;
	private TextView public_title_RightTextView;
	//声明标题View
	private View title_View;
	
	//声明Intent接收参数
	private Intent intent;
	
	//声明顶部要显示的内容组件		姓名， 性别		年龄			区域		地点
	private TextView text_Name,text_Sex,text_age,text_area,text_site;
	
	//声明要基本资料显示数据的组件		姓，字辈，名，性别，	排行，出生日期,出生地点，	学历，职业，地址	手机，QQ,微信,个人描述
	private TextView textView_surname,textView_generation,textView_Name,textView_Sex,
					 textView_seniority,textView_Birthdate,textView_incunabulum,
					 textView_education,textView_occupation,textView_site,
					 textView_Phone,textView_QQ,textView_weChat,textView_individual;
	
	private TextView textView_Time;
	
	//声明删除联系人按钮
	private Button delete_button;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_relatives_information_details);
		
		//初始化Title
		info_Title();
		
		//初始化Intet
		intfo_Intent();
	}

	/**
	 * 接收传递过来的参数并处理
	 */
	private void intfo_Intent(){
		//初始化顶点要显示的组件
		text_Name = (TextView) findViewById(R.id.activity_relatives_information_datails_topName);
		text_Sex = (TextView) findViewById(R.id.activity_relatives_information_datails_Sex);
		text_age = (TextView) findViewById(R.id.activity_relatives_information_datails_Age);
		text_area = (TextView) findViewById(R.id.activity_relatives_information_datails_Area);
		text_site = (TextView) findViewById(R.id.activity_relatives_information_datails_Site);
		
		
		//初始化基本资料要显示的组件
		textView_surname = (TextView) findViewById(R.id.activity_relatives_information_datails_Name);
		textView_generation = (TextView) findViewById(R.id.activity_relatives_information_datails_Character_Generation);
		textView_Name = (TextView) findViewById(R.id.activity_relatives_information_datails_NameContent);
		textView_Sex = (TextView) findViewById(R.id.activity_relatives_information_datails_SexContent);
		
		textView_seniority = (TextView) findViewById(R.id.activity_relatives_information_datails_Seniority_Content);
		textView_Birthdate = (TextView) findViewById(R.id.activity_relatives_information_datails_Birthday_Content);
		textView_incunabulum = (TextView) findViewById(R.id.activity_relatives_information_datails_BirthPlace);
		
		textView_education = (TextView) findViewById(R.id.activity_relatives_information_datails_Education_Content);
		textView_occupation = (TextView) findViewById(R.id.activity_relatives_information_datails_Character_Occupation_Content);
		textView_site = (TextView) findViewById(R.id.activity_relatives_information_datails_Address_Content);
		
		textView_Phone = (TextView) findViewById(R.id.activity_relatives_information_datails_Phone_Content);
		textView_QQ = (TextView) findViewById(R.id.activity_relatives_information_datails_QQ_Content);
		textView_weChat = (TextView) findViewById(R.id.activity_relatives_information_datails_WeChat_Content);
		textView_individual = (TextView) findViewById(R.id.activity_relatives_information_datails_individual);
		
		//时间轴跳转
		textView_Time = (TextView) findViewById(R.id.activity_relatives_information_datails_TextView_Time);
		textView_Time.setOnClickListener(this);
		
		//删除联系人按钮
		delete_button = (Button) findViewById(R.id.activity_relatives_information_datails_button_deleteSomeOne);
		delete_button.setOnClickListener(this);
		
		//初始化意图
		intent = getIntent();
		String name = intent.getStringExtra("list_Name");
		if(intent!=null){
			text_Name.setText(name);
		}
		
	}
	
	/**
	 * 初始化标题
	 */
	private void info_Title(){
		
		//初始化标题
		title_View = findViewById(R.id.activity_relatives_information_datails_include);
		public_title = new Public_title_dynamic(title_View);
		
		//设置标题
		public_title.setTextView("详情资料");
		public_title.setTextRight("编辑");
 		public_title.setLeftImage(R.drawable.back);
 		//public_title.setLeftTextViewVisible_Gone();
 		
 		//初始化标题中的控件
 		public_title_LeftImage = (ImageView) title_View.findViewById(R.id.public_title_dynamic__liftImage);
 		public_title_RightTextView = (TextView) title_View.findViewById(R.id.public_title_dynamic_textViewright);
 		
 		public_title_LeftImage.setOnClickListener(this);
 		public_title_RightTextView.setOnClickListener(this);
	}
	

	/**
	 * 监听事件
	 */
	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		switch (arg0.getId()) {
		
		//标题左边图标监听事件
		case R.id.public_title_dynamic__liftImage:
			finish();
			break;
			
		//标题右边文本监听事件
		case R.id.public_title_dynamic_textViewright:
			intent = new Intent(getApplicationContext(),new Relatives_information_details_Changeinfo().getClass());
			startActivity(intent);
			break;

		//删除联系人
		case R.id.activity_relatives_information_datails_button_deleteSomeOne:
			finish();
			break;
			
			//时间轴跳转
		case R.id.activity_relatives_information_datails_TextView_Time:
			if(intent!=null){
				intent =null;
			}
			 intent = new Intent(Relatives_information_details.this,new Activity_relatives_Fusion().getClass());
			startActivity(intent);
			break;
		default:
			break;
		}
	}

}
